/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-18 10:03:03
 * @LastEditTime: 2021-05-20 14:15:13
 * @LastEditors: XieQiu 雪球
 * @Description: 历史巡查记录接口
 */
import request from '@/utils/request'

export default {
  /**
   * @description: 获取历史巡查记录列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getInspectionTaskList(params) {
    return request.post("/v3/patrol/inspectionTask/queryPageList", params)
  },
  getInspectionResultList(params) {
    return request.post("/v3/patrol/inspectionResult/queryByCondition", {
      inspectionTaskId: params.inspectionTaskId,
      organizationNo: sessionStorage.organizationNo
    })
  },
  // 删除历史记录
  delInspectionRouteInfo(inspectionTaskIdList) {
    return request.post('/v3/patrol/inspectionTask/delList', {
      'inspectionTaskIdList': inspectionTaskIdList
    });
  },

  /**
   * @description: 根据inspectionTaskId查询巡查结果 *代表必填
   * @param {String} inspectionTaskId *
   * @return {Array}
   */
  getResultByInspectionTaskId(inspectionTaskId) {
    return request.get(`/v3/patrol/inspectionResult/query/${inspectionTaskId}`);
  },
  /**
   * @description: 根据 taskResultId查询巡查结果的巡查点详情 *代表必填
   * @param {String}  taskResultId *
   * @return {Array}
   */
  getResultByTaskResultId(taskResultId) {
    return request.post('/v3/patrol/taskResultInfo/queryByCondition', {
      taskResultId: taskResultId
    });
  },
  /**
   * @description: 根据collectionPictureId查图片 *代表必填
   * @param {String} collectionPictureId *
   * @return {Array}
   */
  getPictureMessage(collectionPictureId) {
    return request.get(`/v3/patrol/contractPicture/query/${collectionPictureId}`);
  },
  /**
   * @description: 获取所有巡查路线 *代表必填
   * @param {String} organizationNo *
   * @return {Array}
   */
  inspectionRouteCondition() {
    return request.post("/v3/patrol/inspectionRoute/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 获取所有巡查人列表 *代表必填
   * @param {String} baseId *
   * @return {Array}
   */
  getAllStaffList() {
    return request.get("/v3/patrol/employee/queryByCondition", {
      params: {
        organizationNo: sessionStorage.organizationNo
      }
    });
  },
  queryByConditionList(params) {
    return request.post("/v3/patrol/picture/queryByCondition", {
      pictureId: params.pictureId
    });
  }

};
